package com.amazon;

/**
 * 亚马逊站点
 *
 * @author liudd
 */
public enum AmazonSpiSite {


    // North America
    CA("https://sellercentral.amazon.ca", "https://sellingpartnerapi-na.amazon.com", "NA", "A2EUQ1WTGCTBG2", "加拿大","http://www.amazon.ca/","us-east-1","CAD"), //	Canada
    US("https://sellercentral.amazon.com", "https://sellingpartnerapi-na.amazon.com", "NA", "ATVPDKIKX0DER", "美国","http://www.amazon.com/","us-east-1","USD"), //	United States
    MX("https://sellercentral.amazon.com.mx", "https://sellingpartnerapi-na.amazon.com", "NA", "A1AM78C64UM0Y8", "墨西哥","http://www.amazon.com.mx/","us-east-1","MXN"), //	Mexico
    BR("https://sellercentral.amazon.com.br", "https://sellingpartnerapi-na.amazon.com", "NA", "A2Q3Y263D00KWC", "巴西","http://www.amazon.com/","us-east-1","BRL"), //	Brazil
    // Europe
    ES("https://sellercentral-europe.amazon.com", "https://sellingpartnerapi-eu.amazon.com", "EU", "A1RKKUPIHCS9HS", "西班牙","http://www.amazon.es/","eu-west-1","EUR"), //	Spain  西班牙
    UK("https://sellercentral-europe.amazon.com", "https://sellingpartnerapi-eu.amazon.com", "EU", "A1F83G8C2ARO7P", "英国","http://www.amazon.co.uk/","eu-west-1","GBP"), //	United Kingdom
    FR("https://sellercentral-europe.amazon.com", "https://sellingpartnerapi-eu.amazon.com", "EU", "A13V1IB3VIYZZH", "法国","http://www.amazon.fr/","eu-west-1","EUR"), //	France  法国
    NL("https://sellercentral.amazon.nl", "https://sellingpartnerapi-eu.amazon.com", "EU", "A1805IZSGTT6HS", "荷兰","http://www.amazon.nl/","eu-west-1","EUR"), //	The Netherlands  荷兰
    DE("https://sellercentral-europe.amazon.com", "https://sellingpartnerapi-eu.amazon.com", "EU", "A1PA6795UKMFR9", "德国","http://www.amazon.de/","eu-west-1","EUR"), //	Germany
    IT("https://sellercentral-europe.amazon.com", "https://sellingpartnerapi-eu.amazon.com", "EU", "APJ6JRA9NG5V4", "意大利","http://www.amazon.it/","eu-west-1","EUR"), //	Italy
    SE("https://sellercentral.amazon.se", "https://sellingpartnerapi-eu.amazon.com", "EU", "A2NODRKZP88ZB9", "瑞典","http://www.amazon.se/","eu-west-1","SEK"), //	Sweden  瑞典
    PL("https://sellercentral.amazon.pl", "https://sellingpartnerapi-eu.amazon.com", "EU", "A1C3SOZRARQ6R3", "波兰","http://www.amazon.pl/","eu-west-1","PLN"), //	Poland  波兰
    TR("https://sellercentral.amazon.com.tr", "https://sellingpartnerapi-eu.amazon.com", "EU", "A33AVAJ2PDY3EV", "土耳其","http://www.amazon.tr/","eu-west-1","TRY"), //	  Turkey  土耳其
    AE("https://sellercentral.amazon.ae", "https://sellingpartnerapi-eu.amazon.com", "EU", "A2VIGQ35RCS4UG", "阿联酋","http://www.amazon.ae/","eu-west-1","AED"), //	U.A.E.  阿联酋
    IN("https://sellercentral.amazon.in", "https://sellingpartnerapi-eu.amazon.com", "EU", "A21TJRUUN4KGV", "印度","http://www.amazon.in/","eu-west-1","INR"), //	India 印度
    // Far East
    SG("https://sellercentral.amazon.sg", "https://sellingpartnerapi-fe.amazon.com", "FE", "A19VAU5U5O7RUS", "新加坡","http://www.amazon.fe/","us-west-2","SGD"), //	Singapore
    AU("https://sellercentral.amazon.com.au", "https://sellingpartnerapi-fe.amazon.com", "FE", "A39IBJ37TRP1C6", "澳大利亚","http://www.amazon.com.au/","us-west-2","AUD"), //	Australia
    JP("https://sellercentral.amazon.co.jp", "https://sellingpartnerapi-fe.amazon.com", "FE", "A1VC38T7YXB528", "日本","http://www.amazon.co.jp/","us-west-2","JPY"); //	Japan

    // 卖家中心URL  授权的时候需要调转到卖家中心
    private String sellercentralUrl;
    // SPI 接口endpoint
    private String spiEndpoint;
    // 大区
    private String region;
    // 市场ID
    private String marketplaceId;
    // 中文名称
    private String cnName;
    // 市场域名
    private String domain;
    // AWS 区域
    private String awsRegion;
    // 币种
    private String currencyCode;

    /**
     * 构造函数
     * @param sellercentralUrl
     * @param spiEndpoint
     * @param region
     * @param marketplaceId
     * @param cnName
     * @param domain
     */
    AmazonSpiSite(String sellercentralUrl, String spiEndpoint, String region,
                  String marketplaceId, String cnName, String domain, String awsRegion, String currencyCode) {
        this.sellercentralUrl = sellercentralUrl;
        this.spiEndpoint = spiEndpoint;
        this.region = region;
        this.marketplaceId = marketplaceId;
        this.cnName =cnName;
        this.domain = domain;
        this.awsRegion = awsRegion;
        this.currencyCode = currencyCode;
    }


    public String getSellercentralUrl() {
        return sellercentralUrl;
    }

    public String getSpiEndpoint() {
        return spiEndpoint;
    }

    public String getRegion() {
        return region;
    }

    public String getMarketplaceId() {
        return marketplaceId;
    }

    public String getCnName() {
        return cnName;
    }

    public String getDomain() {
        return domain;
    }

    public String getAwsRegion() {
        return awsRegion;
    }

    public String getCurrencyCode() {
        return currencyCode;
    }

    /**
     * 根据站点名称获取AmazonSpiSite
     * @param site
     * @return
     */
    public static AmazonSpiSite getAmazoApiSite(String site){
        for (AmazonSpiSite amazonSpiSite : AmazonSpiSite.values()){
            if (amazonSpiSite.name().equals(site)){
                return amazonSpiSite;
            }
        }
        return null;
    }



}
